﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using Common;

namespace CNCSoft.ErpApps.TMS.longGiaoVu
{
    public partial class frmViewChuyenLop : Form
    {
        private SqlConnection conn = new SqlConnection(GlobalVariable.WSInfo.ConnectionString);
        private DataSet ds = new DataSet();

        public frmViewChuyenLop()
        {
            InitializeComponent();
        }

        private void frmViewChuyenLop_Load(object sender, EventArgs e)
        {
            LoadControl();
        }

        #region "Coding"
        private void LoadControl()
        {
            try
            {
                LoadChuyenLop();
                gridControl_DanhSachChuyenLop.DataSource = ds.Tables["TableHocVienChuyenLop"];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void LoadChuyenLop()
        {
            try
            {
                if (ds.Tables["TableHocVienChuyenLop"] != null)
                    ds.Tables["TableHocVienChuyenLop"].Clear();
                string sql = @"usp_AllHocVienChuyenLop";
                SqlDataAdapter da = new SqlDataAdapter(sql, conn);
                da.Fill(ds, "TableHocVienChuyenLop");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        #endregion
    }
}
